* may need to create an image bigger than the nodes
* allocation
*/
- st_theme_node_get_paint_box (node, &actor_box, &paint_box);
+ st_theme_node_get_background_paint_box (node, &actor_box, &paint_box);
/* translate the boxes so the paint box is at 0,0
*/
{
ClutterActorBox paint_box;
- st_theme_node_get_paint_box (node, &allocation, &paint_box);
+ st_theme_node_get_background_paint_box (node,
+ &allocation,
+ &paint_box);
paint_material_with_opacity (node->prerendered_material,
&paint_box,
content_box->y2 = (int)(0.5 + content_box->y1 + content_height);
}
+/**
+ * st_theme_node_get_background_paint_box:
+ * @node: a #StThemeNode
+ * @allocation: the box allocated to a #ClutterActor
+ * @paint_box: computed box occupied when painting the actor's background
+ *
+ * Gets the box used to paint the actor's background, including the area
+ * occupied by properties which paint outside the actor's assigned allocation.
+ */
+void
+st_theme_node_get_background_paint_box (StThemeNode *node,
+ const ClutterActorBox *actor_box,
+ ClutterActorBox *paint_box)
+{
+ StShadow *background_image_shadow;
+ ClutterActorBox shadow_box;
+
+ g_return_if_fail (ST_IS_THEME_NODE (node));
+ g_return_if_fail (actor_box != NULL);
+ g_return_if_fail (paint_box != NULL);
+
+ background_image_shadow = st_theme_node_get_background_image_shadow (node);
+
+ *paint_box = *actor_box;
+
+ if (!background_image_shadow)
+ return;
+
+ st_shadow_get_box (background_image_shadow, actor_box, &shadow_box);
+
+ paint_box->x1 = MIN (paint_box->x1, shadow_box.x1);
+ paint_box->x2 = MAX (paint_box->x2, shadow_box.x2);
+ paint_box->y1 = MIN (paint_box->y1, shadow_box.y1);
+ paint_box->y2 = MAX (paint_box->y2, shadow_box.y2);
+}
+
/**
* st_theme_node_get_paint_box:
* @node: a #StThemeNode
ClutterActorBox *paint_box)
{
StShadow *box_shadow;
- StShadow *background_image_shadow;
ClutterActorBox shadow_box;
int outline_width;
g_return_if_fail (paint_box != NULL);
box_shadow = st_theme_node_get_box_shadow (node);
- background_image_shadow = st_theme_node_get_background_image_shadow (node);
outline_width = st_theme_node_get_outline_width (node);
- *paint_box = *actor_box;
+ st_theme_node_get_background_paint_box (node, actor_box, paint_box);
- if (!box_shadow && !background_image_shadow && !outline_width)
+ if (!box_shadow && !outline_width)
return;
paint_box->x1 -= outline_width;
{
st_shadow_get_box (box_shadow, actor_box, &shadow_box);
- paint_box->x1 = MIN (paint_box->x1, shadow_box.x1);
- paint_box->x2 = MAX (paint_box->x2, shadow_box.x2);
- paint_box->y1 = MIN (paint_box->y1, shadow_box.y1);
- paint_box->y2 = MAX (paint_box->y2, shadow_box.y2);
- }
-
- if (background_image_shadow)
- {
- st_shadow_get_box (background_image_shadow, actor_box, &shadow_box);
-
paint_box->x1 = MIN (paint_box->x1, shadow_box.x1);
paint_box->x2 = MAX (paint_box->x2, shadow_box.x2);
paint_box->y1 = MIN (paint_box->y1, shadow_box.y1);